<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/8
 * Time: 11:26
 */
/**
 * 去除HTML及空格、换行
 * [cutstr_html description]
 * @param  [type] $string [description]
 * @param  [type] $sublen [description]
 * @return [type]         [description]
 */
function cutstr_html($string,$sublen){  
    $string = strip_tags($string);  
    $string = trim($string);  
    $string = ereg_replace("\t","",$string);  
    $string = ereg_replace("\r\n","",$string);  
    $string = ereg_replace("\r","",$string);  
    $string = ereg_replace("\n","",$string);  
    $string = ereg_replace(" ","",$string);  
    $string = ereg_replace("　","",$string);  
    $string = preg_replace('/^(&nbsp;|\s)*|(&nbsp;|\s)*$/', '', $string);  

    return mb_substr($string,0,$sublen,'UTF-8')."...";

}